<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
    
<head>
        <title>人工智能综合服务平台</title><meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="stylesheet" href="./static/css/bootstrap.min.css" />
		<link rel="stylesheet" href="./static/css/bootstrap-responsive.min.css" />
        <link rel="stylesheet" href="./static/css/matrix-login.css" />
        <link href="./static/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <script type="text/javascript">
        function login() {
            $.ajax({
                //几个参数需要注意一下
                type: "POST",//方法类型
                dataType: "json",//预期服务器返回的数据类型
                url: "/userLogin",//url
                data: $('#loginform').serialize(),
                success: function (result) {
                    console.log(result);//打印服务端返回的数据(调试用)
                    if (result.code == 100) {
                        $('#loginmessage').html(result.message);
                        document.cookie="token="+result.data;
                        location.href="/task/singlechoiceadd";
                    }
                    if (result.code == 101) {
                        $('#loginmessage').html(result.message);
                    }
                },
                error : function() {
                    alert("异常！");
                }
            });
        }
    </script>
</head>
<body>
<div id="loginbox">
    <form id="loginform" class="form-vertical" action="./userLogin" method="post">
        <div class="control-group normal_text"> <h3><img src="./static/img/logo.png" alt="Logo" /></h3></div>
        <div class="control-group">
            <div class="controls">
                <div class="main_input_box">
                    <span class="add-on bg_lg"><i class="icon-user"></i></span><input type="text"  name="userName" placeholder="admin" />
                </div>
            </div>
        </div>
        <div class="control-group">
            <div class="controls">
                <div class="main_input_box">
                    <span class="add-on bg_ly"><i class="icon-lock"></i></span><input type="password" name="passWord" placeholder="admin" />
                </div>
            </div>



        </div>
        <div class="form-actions">
            <span class="pull-left"><a href="#" class="flip-link btn btn-info" id="to-recover">Lost password?</a></span>
            <span class="pull-right"><input type="button"  class="btn btn-success" value='login' onclick="login()" /></span>
        </div>

        <div align="center"><a id="loginmessage"></a></div>
        <!-- th:text="${message}" -->

    </form>
    <form id="recoverform" action="#" class="form-vertical">
        <p class="normal_text">Enter your e-mail address below and we will send you instructions how to recover a password.</p>

        <div class="controls">
            <div class="main_input_box">
                <span class="add-on bg_lo"><i class="icon-envelope"></i></span><input type="text" placeholder="E-mail address" />
            </div>
        </div>

        <div class="form-actions">
            <span class="pull-left"><a href="#" class="flip-link btn btn-success" id="to-login">&laquo; Back to login</a></span>
            <span class="pull-right"><a class="btn btn-info"/>Reecover</a></span>
        </div>
    </form>
</div>

<script src="./static/js/jquery.min.js"></script>
<script src="./static/js/matrix.login.js"></script>
</body>

</html>